<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Listenable (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">events.Listenable</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    A listenable interface. A listenable is an object with the ability
to dispatch/broadcast events to "event listeners" registered via
listen/listenOnce.

The interface allows for an event propagation mechanism similar
to one offered by native browser event targets, such as
capture/bubble mechanism, stopping propagation, and preventing
default actions. Capture/bubble mechanism depends on the ancestor
tree constructed via <code> #getParentEventTarget</code>; this tree
must be directed acyclic graph. The meaning of default action(s)
in preventDefault is specific to a particular use case.

Implementations that do not support capture/bubble or can not have
a parent listenable can simply not implement any ability to set the
parent listenable (and have <code> #getParentEventTarget</code> return
null).

Implementation of this class can be used with or independently from
goog.events.

Implementation must call <code> #addImplementation(implClass)</code>.


  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="goog.events">Also See:</a></li>
            <li><a href="local_closure_goog_events_listenable.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/events/listenable.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.events.Listenable</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
      <tr><td><span class="type"><a href="interface_goog_net_NetworkStatusMonitor.html">goog.net.NetworkStatusMonitor</a></span></td><td>goog.events.Listenable</td></tr>
  </table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.events.Listenable(<span></span>)
  </div>



<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="interface_goog_events_Listenable.html">
              goog.events.Listenable
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.dispatchEvent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">dispatchEvent<span class="args">(<span class="arg">e</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Dispatches an event (or event like object) and calls all listeners
listening for events of this type. The type of the event is decided by the
type property on the event object.

If any of the listeners returns false OR calls preventDefault then this
function will return false.  If one of the capture listeners calls
stopPropagation, then the bubble listeners won't fire.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">e</span>
        : <span class="type">goog.events.EventLike</span>
        <div class="entryOverview">Event object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            If anyone called preventDefault on the event object (or
    if any of the listeners returns false) this will also return false.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line181">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.fireListeners"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">fireListeners<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">capture</span>,&nbsp;<span class="arg">eventObject</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Fires all registered listeners in this listenable for the given
type and capture mode, passing them the given eventObject. This
does not perform actual capture/bubble. Only implementors of the
interface should be using this.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ</span>&gt;
        <div class="entryOverview">The type of the
    listeners to fire.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">capture</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">The capture mode of the listeners to fire.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">eventObject</span>
        : <span class="type">EVENTOBJ</span>
        <div class="entryOverview">The event object to fire.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether all listeners succeeded without
    attempting to prevent default behavior. If any listener returns
    false or called goog.events.Event#preventDefault, this returns
    false.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line226">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.getListener"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getListener<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">listener</span>,&nbsp;<span class="arg">capture</span>,&nbsp;<span class="arg">opt_listenerScope</span>)</span>
        </span>
        &#8658; <span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>
      </div>


     <div class="entryOverview">
       Gets the goog.events.ListenableKey for the event or null if no such
listener is in use.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ</span>&gt;
        <div class="entryOverview">The name of the event
    without the 'on' prefix.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">listener</span>
        : <span class="type">function(this:SCOPE, EVENTOBJ):(boolean</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)
        <div class="entryOverview">The
    listener function to get.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">capture</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether the listener is a capturing listener.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_listenerScope</span>
        : <span class="type">SCOPE=</span>
        <div class="entryOverview">Object in whose scope to call the
    listener.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>&nbsp;
            the found listener or null if not found.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line256">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.getListeners"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getListeners<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">capture</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>&gt;
      </div>


     <div class="entryOverview">
       Gets all listeners in this listenable for the given type and
capture mode.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>
        <div class="entryOverview">The type of the listeners to fire.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">capture</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">The capture mode of the listeners to fire.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>&gt;&nbsp;
            An array of registered
    listeners.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line239">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.getParentEventTarget"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getParentEventTarget<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="interface_goog_events_Listenable.html">goog.events.Listenable</a></span>
      </div>


     <div class="entryOverview">
       Returns the parent of this event target to use for capture/bubble
mechanism.

NOTE(user): The name reflects the original implementation of
custom event target (<code> goog.events.EventTarget</code>). We decided
that changing the name is not worth it.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="interface_goog_events_Listenable.html">goog.events.Listenable</a></span>&nbsp;
            The parent EventTarget or null if
    there is no parent.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line207">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.hasListener"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">hasListener<span class="args">(<span class="arg">opt_type</span>,&nbsp;<span class="arg">opt_capture</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Whether there is any active listeners matching the specified
signature. If either the type or capture parameters are
unspecified, the function will match on the remaining criteria.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ></span>&gt;
        <div class="entryOverview">Event type.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_capture</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to check for capture or bubble
    listeners.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether there is any active listeners matching
    the requested type and/or capture phase.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line271">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.listen"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">listen<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">listener</span>,&nbsp;<span class="arg">opt_useCapture</span>,&nbsp;<span class="arg">opt_listenerScope</span>)</span>
        </span>
        &#8658; <span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>
      </div>


     <div class="entryOverview">
       Adds an event listener. A listener can only be added once to an
object and if it is added again the key for the listener is
returned. Note that if the existing listener is a one-off listener
(registered via listenOnce), it will no longer be a one-off
listener after a call to listen().


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ</span>&gt;
        <div class="entryOverview">The event type id.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">listener</span>
        : <span class="type">function(this:SCOPE, EVENTOBJ):(boolean</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)
        <div class="entryOverview">Callback
    method.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_useCapture</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to fire in capture phase
    (defaults to false).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_listenerScope</span>
        : <span class="type">SCOPE=</span>
        <div class="entryOverview">Object in whose scope to call the
    listener.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>&nbsp;
            Unique key for the listener.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line114">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.listenOnce"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">listenOnce<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">listener</span>,&nbsp;<span class="arg">opt_useCapture</span>,&nbsp;<span class="arg">opt_listenerScope</span>)</span>
        </span>
        &#8658; <span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>
      </div>


     <div class="entryOverview">
       Adds an event listener that is removed automatically after the
listener fired once.

If an existing listener already exists, listenOnce will do
nothing. In particular, if the listener was previously registered
via listen(), listenOnce() will not turn the listener into a
one-off listener. Similarly, if there is already an existing
one-off listener, listenOnce does not modify the listeners (it is
still a once listener).


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ</span>&gt;
        <div class="entryOverview">The event type id.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">listener</span>
        : <span class="type">function(this:SCOPE, EVENTOBJ):(boolean</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)
        <div class="entryOverview">Callback
    method.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_useCapture</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to fire in capture phase
    (defaults to false).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_listenerScope</span>
        : <span class="type">SCOPE=</span>
        <div class="entryOverview">Object in whose scope to call the
    listener.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>&nbsp;
            Unique key for the listener.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line138">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.removeAllListeners"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">removeAllListeners<span class="args">(<span class="arg">opt_type</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Removes all listeners from this listenable. If type is specified,
it will only remove listeners of the particular type. otherwise all
registered listeners will be removed.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_type</span>
        : <span class="type">string=</span>
        <div class="entryOverview">Type of event to remove, default is to
    remove all types.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            Number of listeners removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line193">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.unlisten"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">unlisten<span class="args">(<span class="arg">type</span>,&nbsp;<span class="arg">listener</span>,&nbsp;<span class="arg">opt_useCapture</span>,&nbsp;<span class="arg">opt_listenerScope</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Removes an event listener which was added with listen() or listenOnce().


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">type</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_events_EventId.html">goog.events.EventId</a></span>.&lt;<span class="type">EVENTOBJ</span>&gt;
        <div class="entryOverview">The event type id.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">listener</span>
        : <span class="type">function(this:SCOPE, EVENTOBJ):(boolean</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)
        <div class="entryOverview">Callback
    method.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_useCapture</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to fire in capture phase
    (defaults to false).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_listenerScope</span>
        : <span class="type">SCOPE=</span>
        <div class="entryOverview">Object in whose scope to call
    the listener.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether any listener was removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line154">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.prototype.unlistenByKey"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">unlistenByKey<span class="args">(<span class="arg">key</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Removes an event listener which was added with listen() by the key
returned by listen().


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="interface_goog_events_ListenableKey.html">goog.events.ListenableKey</a></span>
        <div class="entryOverview">The key returned by
    listen() or listenOnce().</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether any listener was removed.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line165">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>














<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.addImplementation"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.events.Listenable.</span><span class="entryName">addImplementation<span class="args">(<span class="arg">cls</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Marks a given class (constructor) as an implementation of
Listenable, do that we can query that fact at runtime. The class
must have already implemented the interface.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">cls</span>
        : <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class constructor. The corresponding
    class must have already implemented the interface.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line77">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.events.Listenable.isImplementedBy"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.events.Listenable.</span><span class="entryName">isImplementedBy<span class="args">(<span class="arg">obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The object to check.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether a given instance implements
    Listenable. The class/superclass of the instance must call
    addImplementation.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line88">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.events.Listenable.IMPLEMENTED_BY_PROP"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.events.Listenable.</span><span class="entryName">IMPLEMENTED_BY_PROP</span>
        : 
     </div>


     <div class="entryOverview">
       An expando property to indicate that an object implements
goog.events.Listenable.

See addImplementation/isImplementedBy.


     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_events_listenable.js.source.html#line66">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package events</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="events.Listenable"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
